<?php

class AcaoConsulta extends AcaoBase {

    public function getHtml() {
        if ($this->getHabilitada()) {
            $aAtributeImg = array();
            $aAtributeImg['src'] = 'estrutura/img/acao_'.$this->getFormulario()->getAcao().'.gif';
            $aAtributeImg['alt'] = $this->getTitulo();
            $aAtributeImg['title'] = $aAtributeImg['alt'];
            $aAtributeImg['border'] = '0';
            $sHref = $this->getFnLoadPage();
            $sHtml = '<a href=\'javascript:'. $sHref.'\'><img '.$this->getHtmlAtributos($aAtributeImg).'/></a>' . PHP_EOL;  
        }
        else {
            $aAtributeImg = array();
            $aAtributeImg['src'] = 'estrutura/img/acao_des_'.$this->getFormulario()->getAcao().'.gif';
            $aAtributeImg['alt'] = $this->getTitulo();
            $aAtributeImg['title'] = $aAtributeImg['alt'];
            $aAtributeImg['border'] = '0';            
            $sHtml = '<img '.$this->getHtmlAtributos($aAtributeImg).'/>' . PHP_EOL;
        }
        return $sHtml;
    }
    
    public function getHtmlBotao() {
        $oBotao = new Botao($this->getTitulo());
        $oBotao->setOnClick($this->getFnLoadPage());
        return $oBotao->getHtml();
    }
    
}

?>
